package com.cskaoyan.bean.vo;

import com.cskaoyan.bean.po.MarketOrder;
import com.cskaoyan.bean.po.MarketOrderGoods;
import org.springframework.beans.BeanUtils;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @author Trellis
 * @since 2022/09/09 21:49
 */
public class WxOrderDetailVo {

    /**
     * expressInfo : []
     * orderInfo : {"consignee":"usr","address":"河南省驻马店市确山县 邓京龙家","addTime":"2022-01-06 22:58:48","orderSn":"20220106609531","actualPrice":87,"mobile":"13212365478","message":"","orderStatusText":"已收货","aftersaleStatus":0,"goodsPrice":79,"couponPrice":0,"id":1,"freightPrice":8,"handleOption":{"cancel":false,"confirm":false,"rebuy":true,"pay":false,"comment":true,"delete":true,"aftersale":true,"refund":false}}
     * orderGoods : [{"productId":71,"addTime":"2022-01-06 22:58:48","orderId":1,"goodsId":1057036,"goodsSn":"1057036","updateTime":"2022-09-09 17:28:00","specifications":["标准"],"number":1,"picUrl":"http://yanxuan.nosdn.127.net/8a9ee5ba08929cc9e40b973607d2f633.png","deleted":false,"price":79,"comment":1023,"id":1,"goodsName":"日式纯色水洗亚麻抱枕"}]
     */
    private List<Integer> expressInfo = new ArrayList<>();
    private OrderInfoEntity orderInfo = new OrderInfoEntity();
    private List<OrderGoodsEntity> orderGoods = new ArrayList<>();



    public void copyOrderInfo(MarketOrder marketOrder,WxOrderDetailHandleOptionVo optionVo) {
        OrderInfoEntity orderInfoEntity = new OrderInfoEntity();
        OrderInfoEntity.HandleOptionEntity handleOption = orderInfoEntity.handleOption;
        BeanUtils.copyProperties(marketOrder,orderInfoEntity);
        BeanUtils.copyProperties(optionVo,handleOption);
        orderInfo = orderInfoEntity;

    }


    public void copyOrderGoods(MarketOrderGoods marketOrderGoods) {
        OrderGoodsEntity orderGoodsEntity = new OrderGoodsEntity();
        BeanUtils.copyProperties(marketOrderGoods,orderGoodsEntity);
        orderGoods.add(orderGoodsEntity);
    }



    public void setExpressInfo(List<Integer> expressInfo) {
        this.expressInfo = expressInfo;
    }

    public void setOrderInfo(OrderInfoEntity orderInfo) {
        this.orderInfo = orderInfo;
    }

    public void setOrderGoods(List<OrderGoodsEntity> orderGoods) {
        this.orderGoods = orderGoods;
    }

    public List<?> getExpressInfo() {
        return expressInfo;
    }

    public OrderInfoEntity getOrderInfo() {
        return orderInfo;
    }

    public List<OrderGoodsEntity> getOrderGoods() {
        return orderGoods;
    }

    public class OrderInfoEntity {
        /**
         * consignee : usr
         * address : 河南省驻马店市确山县 邓京龙家
         * addTime : 2022-01-06 22:58:48
         * orderSn : 20220106609531
         * actualPrice : 87.0
         * mobile : 13212365478
         * message :
         * orderStatusText : 已收货
         * aftersaleStatus : 0
         * goodsPrice : 79.0
         * couponPrice : 0.0
         * id : 1
         * freightPrice : 8.0
         * handleOption : {"cancel":false,"confirm":false,"rebuy":true,"pay":false,"comment":true,"delete":true,"aftersale":true,"refund":false}
         */
        private String consignee;
        private String address;
        private Date addTime;
        private String orderSn;
        private BigDecimal actualPrice;
        private String mobile;
        private String message;
        private String orderStatusText;
        private int aftersaleStatus;
        private BigDecimal goodsPrice;
        private BigDecimal couponPrice;
        private int id;
        private BigDecimal freightPrice;
        private HandleOptionEntity handleOption = new HandleOptionEntity();

        public void setConsignee(String consignee) {
            this.consignee = consignee;
        }

        public void setAddress(String address) {
            this.address = address;
        }

        public void setAddTime(Date addTime) {
            this.addTime = addTime;
        }

        public void setOrderSn(String orderSn) {
            this.orderSn = orderSn;
        }

        public void setActualPrice(BigDecimal actualPrice) {
            this.actualPrice = actualPrice;
        }

        public void setMobile(String mobile) {
            this.mobile = mobile;
        }

        public void setMessage(String message) {
            this.message = message;
        }

        public void setOrderStatusText(String orderStatusText) {
            this.orderStatusText = orderStatusText;
        }

        public void setAftersaleStatus(int aftersaleStatus) {
            this.aftersaleStatus = aftersaleStatus;
        }

        public void setGoodsPrice(BigDecimal goodsPrice) {
            this.goodsPrice = goodsPrice;
        }

        public void setCouponPrice(BigDecimal couponPrice) {
            this.couponPrice = couponPrice;
        }

        public void setId(int id) {
            this.id = id;
        }

        public void setFreightPrice(BigDecimal freightPrice) {
            this.freightPrice = freightPrice;
        }

        public void setHandleOption(HandleOptionEntity handleOption) {
            this.handleOption = handleOption;
        }

        public String getConsignee() {
            return consignee;
        }

        public String getAddress() {
            return address;
        }

        public Date getAddTime() {
            return addTime;
        }

        public String getOrderSn() {
            return orderSn;
        }

        public BigDecimal getActualPrice() {
            return actualPrice;
        }

        public String getMobile() {
            return mobile;
        }

        public String getMessage() {
            return message;
        }

        public String getOrderStatusText() {
            return orderStatusText;
        }

        public int getAftersaleStatus() {
            return aftersaleStatus;
        }

        public BigDecimal getGoodsPrice() {
            return goodsPrice;
        }

        public BigDecimal getCouponPrice() {
            return couponPrice;
        }

        public int getId() {
            return id;
        }

        public BigDecimal getFreightPrice() {
            return freightPrice;
        }

        public HandleOptionEntity getHandleOption() {
            return handleOption;
        }

        public class HandleOptionEntity {
            /**
             * cancel : false
             * confirm : false
             * rebuy : true
             * pay : false
             * comment : true
             * delete : true
             * aftersale : true
             * refund : false
             */
            private boolean cancel;//系统取消103 用户取消102
            private boolean confirm;//系统确认收获402
            private boolean rebuy;//检查同一个user的id下是否有相同的goodsid
            private boolean pay;//已付款201
            private boolean comment;//是否评论
            private boolean delete;// 直接赋值
            private boolean aftersale;//是否有售后 状态码
            private boolean refund;//查状态码202 系统203

            public void setCancel(boolean cancel) {
                this.cancel = cancel;
            }

            public void setConfirm(boolean confirm) {
                this.confirm = confirm;
            }

            public void setRebuy(boolean rebuy) {
                this.rebuy = rebuy;
            }

            public void setPay(boolean pay) {
                this.pay = pay;
            }

            public void setComment(boolean comment) {
                this.comment = comment;
            }

            public void setDelete(boolean delete) {
                this.delete = delete;
            }

            public void setAftersale(boolean aftersale) {
                this.aftersale = aftersale;
            }

            public void setRefund(boolean refund) {
                this.refund = refund;
            }

            public boolean isCancel() {
                return cancel;
            }

            public boolean isConfirm() {
                return confirm;
            }

            public boolean isRebuy() {
                return rebuy;
            }

            public boolean isPay() {
                return pay;
            }

            public boolean isComment() {
                return comment;
            }

            public boolean isDelete() {
                return delete;
            }

            public boolean isAftersale() {
                return aftersale;
            }

            public boolean isRefund() {
                return refund;
            }
        }
    }

    public class OrderGoodsEntity {
        /**
         * productId : 71
         * addTime : 2022-01-06 22:58:48
         * orderId : 1
         * goodsId : 1057036
         * goodsSn : 1057036
         * updateTime : 2022-09-09 17:28:00
         * specifications : ["标准"]
         * number : 1
         * picUrl : http://yanxuan.nosdn.127.net/8a9ee5ba08929cc9e40b973607d2f633.png
         * deleted : false
         * price : 79.0
         * comment : 1023
         * id : 1
         * goodsName : 日式纯色水洗亚麻抱枕
         */
        private int productId;
        private Date addTime;
        private int orderId;
        private int goodsId;
        private String goodsSn;
        private Date updateTime;
        private List<String> specifications;
        private Short number;
        private String picUrl;
        private boolean deleted;
        private BigDecimal price;
        private int comment;
        private int id;
        private String goodsName;

        public void setProductId(int productId) {
            this.productId = productId;
        }

        public void setAddTime(Date addTime) {
            this.addTime = addTime;
        }

        public void setOrderId(int orderId) {
            this.orderId = orderId;
        }

        public void setGoodsId(int goodsId) {
            this.goodsId = goodsId;
        }

        public void setGoodsSn(String goodsSn) {
            this.goodsSn = goodsSn;
        }

        public void setUpdateTime(Date updateTime) {
            this.updateTime = updateTime;
        }

        public void setSpecifications(List<String> specifications) {
            this.specifications = specifications;
        }

        public void setNumber(Short number) {
            this.number = number;
        }

        public void setPicUrl(String picUrl) {
            this.picUrl = picUrl;
        }

        public void setDeleted(boolean deleted) {
            this.deleted = deleted;
        }

        public void setPrice(BigDecimal price) {
            this.price = price;
        }

        public void setComment(int comment) {
            this.comment = comment;
        }

        public void setId(int id) {
            this.id = id;
        }

        public void setGoodsName(String goodsName) {
            this.goodsName = goodsName;
        }

        public int getProductId() {
            return productId;
        }

        public Date getAddTime() {
            return addTime;
        }

        public int getOrderId() {
            return orderId;
        }

        public int getGoodsId() {
            return goodsId;
        }

        public String getGoodsSn() {
            return goodsSn;
        }

        public Date getUpdateTime() {
            return updateTime;
        }

        public List<String> getSpecifications() {
            return specifications;
        }

        public int getNumber() {
            return number;
        }

        public String getPicUrl() {
            return picUrl;
        }

        public boolean isDeleted() {
            return deleted;
        }

        public BigDecimal getPrice() {
            return price;
        }

        public int getComment() {
            return comment;
        }

        public int getId() {
            return id;
        }

        public String getGoodsName() {
            return goodsName;
        }
    }
}
